# Maintainer: Celeste <cielesti@protonmail.com>
maintainer="Celeste <cielesti@protonmail.com>"
pkgname=emacs-with-editor
pkgver=3.3.4
pkgrel=0
_pkgreal=with-editor
pkgdesc="Use Emacsclient as EDITOR of child processes"
url="https://github.com/magit/with-editor"
arch="noarch"
license="GPL-3.0-or-later"
depends="
	cmd:emacs
	emacs-compat
	"
makedepends="emacs-nox"
source="https://github.com/magit/with-editor/archive/v$pkgver/emacs-with-editor-$pkgver.tar.gz"
builddir="$srcdir/$_pkgreal-$pkgver/lisp"
options="!check" # no tests provided

build() {
	emacs -batch -q -no-site-file -L . \
		-eval '(setq byte-compile-error-on-warn t)' \
		-f batch-byte-compile \
		./*.el
}

package() {
	install -Dvm644 ./*.el ./*.elc \
		-t "$pkgdir"/usr/share/emacs/site-lisp/

	cd "$pkgdir"/usr/share/emacs/site-lisp
	emacs -batch -q -no-site-file \
		-eval "(loaddefs-generate \".\" \"$_pkgreal-loaddefs.el\")"
}

sha512sums="
700f6e5a884e4664b2450f7dd3ea879f45934abdbc09eb9569a58233d57ad7411a47d977341231b5c23a2ae5710ce490b2ee3960aee150e912a3ec0017665942  emacs-with-editor-3.3.4.tar.gz
"
